<?=form_open(current_url())?>
<fieldset>
    <legend>Edit <?php echo $edit['name']?></legend>
	<div class="row-fluid">
		<div class="span4">
			<label> <strong>Assigned to  </strong><small class="muted">Select the user to whom project will be assigned</small></label>
    <select class="chzn-select" name="user">
    <option value=""  >Select a User</option>
     <?php foreach ($users as $user) {?>
      <option value="<?=$user->user_id?>"
	  <?php 
	  if($edit['assigned_to'] == $user->user_id){
	  	echo 'selected="selected"';
	  }
	  ?>
	  ><?=$user->username?></option>
     <?php }?>
    </select>
    <span class="text-error"><?= form_error('user')?></span>
			
		</div>
		<div class="span5">
			<label> <strong>Department  </strong><small class="muted">Select the user to whom project will be assigned</small></label>
    <select class="chzn-select" name="department_id">
    <option value=""  >Select a department</option>
     <?php foreach ($departments as $department) {?>
      <option value="<?=$department->id?>"
	  <?php 
	  if($edit['department_id'] == $department->id){
	  	echo 'selected="selected"';
	  }
	  ?>
	  ><?=$department->name?></option>
     <?php }?>
    </select>
    <span class="text-error"><?= form_error('user')?></span>
			
		</div>
		<div class="span3">
		<label> <strong>Client</strong>  <a href="#" class="tooltips" title="Select client or choose none"><i class="icon-question-sign"></i></a> <small></small></label>
		 <select class="chzn-select" name="client_id">
    	 <option value="0">Select Client</option>
		 <?php foreach($clients as $client) {?>
		 <option value="<?php echo $client->id; ?>" 
		 <?php 
	  if($edit['client_id'] == $client->id){
	  	echo 'selected="selected"';
	  }
	  ?>
		 ><?php echo $client->first_name ?></option>
		 <?php }?>
    </select>
	<label><a href="<?php echo site_url().'/'.'client/client/add_client'?>"><i class="icon-plus-sign "></i> Add client</a></label>
	</div>
		
	</div>
	<br />	
	<label> <strong>Project Name  </strong><small class="muted">Name / title of the project</small></label>
    <input type="text" name="name" value="<?= $edit['name']?>" class="span12" />
    <span class="text-error"><?= form_error('name')?></span>
	
	
	<label> <strong>Description  </strong><small class="muted">description of the current project</small></label>
    <textarea name="desc" class="span12"><?= $edit['name']?></textarea>
    <span class="text-error"><?= form_error('desc')?></span>
	
	<label> <strong>Start date  </strong><small class="muted">Choose a time when the project will be started</small></label>
    <input type="text" name="start_date" id="dpd1"  value="<?= $edit['start_date']?>" class="span12"/>
    <span class="text-error"><?= form_error('start_date')?></span>
	
	<label> <strong>Due Date  </strong><small class="muted">Last date of the project to be completed</small></label>
    <input type="text" name="due_date" id="dpd2" value="<?= $edit['end_date'];?>" class="span12"/>
    <span class="text-error"><?= form_error('due_date')?></span>
	<br />	
	<button class="btn btn-success pull-right">Update</button>	
	</fieldset>   
</form>


